import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'

interface DataType {
    key: string;
    brand?: string;// 品牌
    partition?: string;// 区域
    platform?: string; // 平台
    shop?: string; // 店铺
    Platformsettlementamount:number;
    Platformactivitysubsidyamount:number;
    sum:number,
    children?: DataType[];
    date: string; // 日期
}

@Schema()

export class Store {
    @Prop({type:String})
    key: string;
    @Prop({type:String})
    brand?: string;// 品牌
    @Prop({type:String})
    partition?: string;// 区域
    @Prop({type:String})
    platform?: string; // 平台
    @Prop({type:String})
    shop?: string; // 店铺
    @Prop({type:Number})
    Platformsettlementamount:number;
    @Prop({type:Number})
    Platformactivitysubsidyamount:number;
    @Prop({type:Number})
    sum:number
    @Prop({type:Array<DataType>})
    children?: DataType[];
    @Prop({type:String})
    date: string; // 日期
}

export const StoreSchema = SchemaFactory.createForClass(Store)